package com.kyub.spring.gears.test.objscan;

import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: sreghenzi
 * Date: 2-gen-2009
 * Time: 16.22.57
 * To change this template use File | Settings | File Templates.
 */
public class Pet {

    private Long id;

    private String name;

    private Person owner = new Person(99l, "Unbound person");

    private Boolean vacine;

    private Date birthDate;

    public Pet() {
    }

    public Pet(Long id, String name, Boolean vacABoolean, Date birthDate) {
        this.id = id;
        this.name = name;
        this.vacine = vacABoolean;
        this.birthDate = birthDate;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Person getOwner() {
        return owner;
    }

    public void setOwner(Person owner) {
        this.owner = owner;
    }

    public Boolean getVacine() {
        return vacine;
    }

    public void setVacine(Boolean vacine) {
        this.vacine = vacine;
    }

    public Date getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    public String toString() {
        return this.name;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Pet)) return false;

        Pet pet = (Pet) o;

        if (id != null ? !id.equals(pet.id) : pet.id != null) return false;
        if (name != null ? !name.equals(pet.name) : pet.name != null) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = (id != null ? id.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        return result;
    }
}